home *** CD-ROM | disk | FTP | other *** search
- ;void column_color_b(col,row,depth,color);
- ; unsigned char col,row,depth,color;
-
- EXTRN _memory_model:byte
- EXTRN _video_page:byte
-
- _TEXT SEGMENT BYTE PUBLIC 'CODE'
- ASSUME CS:_TEXT
- PUBLIC _column_color_b
- _column_color_b proc near
- push bp ;
- mov bp,sp ;set stack frame
- push di ;
- cmp _memory_model,0 ;near or far?
- jle begin ;jump if near
- inc bp ;else add 2 to BP
- inc bp ;
- begin: mov bh,_video_page ;set video page
- mov dl,[bp+4] ;Col in DL
- dec dl ;count from 0
- mov dh,[bp+6] ;Row in DH
- dec dh ;count from 0
- sub ax,ax ;
- mov al,[bp+8] ;depth
- mov di,ax ;
- or di,di ;check for null
- jz L2 ;quit if null
- mov bl,[bp+10] ;new attribute in BL
- mov cx,1 ;number chars to write
- L1: mov ah,2 ;function to set cursor
- int 10h ;set cursor
- mov ah,8 ;func to read char:attri
- int 10h ;now AL:AH has char:attri
- mov ah,9 ;func to write char:attri
- int 10h ;write char w new attri
- cmp dh,24 ;bottom of column?
- je L2 ;quit at bottom
- inc dh ;point to next row
- dec di ;dec char counter
- jnz L1 ;loop if not finished
- L2: pop di ;
- pop bp ;
- cmp _memory_model,0 ;quit
- jle quit ;
- db 0CBh ;RET far
- quit: ret ;RET near
- _column_color_b endp
- _TEXT ENDS
- END